home *** CD-ROM | disk | FTP | other *** search
- Path: news.inc.net!it!pendrick
- From: pendrick@it.uwp.edu (Richard Pendrick)
- Newsgroups: comp.lang.c++
- Subject: Q: structures&arrays
- Date: 19 Apr 1996 22:25:11 GMT
- Organization: University of Wisconsin - Parkside
- Message-ID: <4l93s7$9ej@news.inc.net>
- NNTP-Posting-Host: 131.210.1.100
- X-Newsreader: TIN [version 1.2 PL2]
-
- I would appreciate it if someone could enlighten me on why the below
- program errors, and what the correct procedure is for initializing an
- array of a structure.
- -------------------------------------------------------------
- // HELP!
-
- #include <iostream.h>
-
- struct foo
- {
- char n[30];
- int p;
- };
-
- int main(void)
- {
- foo f[5];
-
- f[0] = { "rick", 1 }; // compiler reports "parse error before '{'"
-
- return 0;
- }
- ---------------------------------------------------------------
- Thank you for any help!
-
- rickp
-
-
- Good times and riches and son-of-a-bitches,
- I've seen more than I can recall...
- -J. Buffett
-
-